(function ($) {
    $.fn.validationEngineLanguage = function () { };
    $.validationEngineLanguage = {
        newLang: function () {
            $.validationEngineLanguage.allRules = {
                // Add your regex rules here, you can take telephone as an example
                "required": {
                    "regex": "none",
                    "alertText": "* 此欄為必填項",
                    "alertTextCheckboxMultiple": "* 請選擇一個選項",
                    "alertTextCheckboxe": "* 此選擇框為必選"
                },
                "min": {
                    "regex": "none",
                    "alertText": "* 最小值是"
                },
                "max": {
                    "regex": "none",
                    "alertText": "* 最大值是"
                },
                "minSize": {
                    "regex": "none",
                    "alertText": "* 最小長度",
                    "alertText2": " 的字符"
                },
                "maxSize": {
                    "regex": "none",
                    "alertText": "* 最大長度",
                    "alertText2": " 的字符"
                },
                "jpg": {
                    "regex": "^.*?\.([j|J][p|P][g|G]|[j|J][p|P][e|E][g|G])$",
                    "alertText": "* 只能上傳jpg圖片"
                },
                "maxCheckbox": {
                    "regex": "none",
                    "alertText": "* 復選框超過最大可選數"
                },
                "minCheckbox": {
                    "regex": "none",
                    "alertText": "* 請至少選擇 ",
                    "alertText2": " 項"
                },
                "equals": {
                    "regex": "none",
                    "alertText": "* 兩次輸入不相同"
                },
                "notequals": {
                    "regex": "none",
                    "alertText": "* 兩次或兩次以上輸入相同"
                },
                "confirm": {
                    "regex": "none",
                    "alertText": "* 您的輸入有誤，請重新輸入"
                },
                "telephone": {
                    //"regex":"/^[0-9\-\(\)\ ]+$/",
                    "regex": "\d{3}-\d{8}|\d{4}-\d{7}|\d{8}|\d{7}",
                    "alertText": "* 您輸入的電話號碼格式有誤"
                },
                "mobilenumber": {
                    "regex": /^0{0,1}(13[0-9]|15[0-9]|18[0-9])[0-9]{8}$/,
                    "alertText": "* 手機號碼格式有誤"
                },
                "path": {
                    "regex": /^[a-zA-Z]:(\\).*$/,
                    "alertText": "* 您輸入的路徑格式有誤"
                },
                "pathHttp": {
                    "regex": /^(http|HTTP)\:\/\/.*$/,
                    "alertText": "* 您輸入的路徑格式有誤"
                },
                "email": {
                    "regex": "/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/",
                    "alertText": "* 您輸入的電子郵件地址格式有誤"
                },
                "date": {
                    "regex": "/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/",
                    "alertText": "* 您輸入的時間格式有誤，時間格式為：YYYY-MM-DD"
                },
                "HH": {
                    "regex": /^(([0-1][0-9])|(2[0-4]))$/,
                    "alertText": "* 您輸入的時間格式有誤，時間格式為：HH</br>{範圍（00- 24）}"
                },
                "ipAddress": {
                    //(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])
                    //(([0-9a-zA-Z][0-9a-zA-Z-]{0,62}\.)+([0-9a-zA-Z][0-9a-zA-Z-]{0,62})\.?)
                    "regex": /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|([w|W]{3}\\.)?([a-zA-z0-9])+(\.[a-z]{2,3})$/,
                    "alertText": "* IP地址格式不正確"
                },
                "number": {
                    // Number, including positive, negative, and floating decimal. credit: orefalo
                    "regex": /^[\-\+]?(([0-9]+)([\.]([0-9]+))?|([\.]([0-9]+))?)$/,
                    "alertText": "* 無效的數字"
                },
                "onlyNumber": {
                    "regex": /^[0-9]+$/,
                    "alertText": "* 請輸入數字"
                },
                "integer": {
                    "regex": /^[\-\+]?\d+$/,
                    "alertText": "* 無效的整數"
                },
                "noSpecialCaracters": {
                    "regex": "/^[0-9a-zA-Z]+$/",
                    "alertText": "* 請去掉特殊字符，重新輸入"
                },
                "noChinese": {
                    "regex": /^[^\u4e00-\u9fa5]+$/,
                    "alertText": "* 請去掉中文字符，重新輸入"
                },
                "ajaxCheckCompanyCode": {
                    "url": "CheckCompanyCode",
                    "extraDataDynamic": ['#COMCode', '#CreatedBy'],
                    "alertText": "* 該公司編號已存在",
                    "alertTextLoad": "* 驗證中，請稍後"
                },
                "ajaxCheckDepartmentCode": {
                    "url": "CheckDepartmentCode",
                    "extraDataDynamic": ['#DEPTCode', '#CreatedBy'],
                    "alertText": "* 該部門編號已存在",
                    "alertTextLoad": "* 驗證中，請稍後"
                },
                "ajaxCheckPositionCode": {
                    "url": "CheckPositionCode",
                    "extraDataDynamic": ['#POSCode', '#CreatedBy'],
                    "alertText": "* 該崗位編號已存在",
                    "alertTextLoad": "* 驗證中，請稍後"
                },
                "ajaxCheckEmployeeTypeCode": {
                    "url": "CheckEmployeeTypeCode",
                    "extraDataDynamic": ['#EMPType', '#CreatedBy'],
                    "alertText": "* 該類型編號已存在",
                    "alertTextLoad": "* 驗證中，請稍後"
                },
                "ajaxCheckTEAMCode": {
                    "url": "CheckTeamCode",
                    "extraDataDynamic": ['#TEAMCode', '#CreatedBy'],
                    "alertText": "* 該分組編號已存在",
                    "alertTextLoad": "* 驗證中，請稍後"
                },

            }
        }
    }
})(jQuery);

$(document).ready(function () {
    $.validationEngineLanguage.newLang()
});